/*
 * @Author: taosong 2289713738@qq.com
 * @Date: 2023-12-15 20:44:36
 * @LastEditors: taosong 2289713738@qq.com
 * @LastEditTime: 2023-12-19 16:17:45
 * @FilePath: \ele-h5\vite.config.ts
 * @Description:
 *
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
 */
import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
// 引入unplugin-vue-components插件  用来配置按需引入vant 达到压缩css体积目的
// import Components from 'unplugin-vue-components/vite'
// import { VantResolver } from 'unplugin-vue-components/resolvers'

// https://vitejs.dev/config/
export default defineConfig({
  // Components({ resolvers: [VantResolver()]})
  plugins: [vue(), vueJsx()],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  },
  server: {
    port: 3000,
    proxy: {
      '/api': 'http://localhost:8000',
      '/imgs': 'http://localhost:8000'
    }
  }
})
